﻿using System;

class CheckCircleAndRectangle
{
    static void Main()
    {
        Console.Write("Enter the coordinates of the point:\r\nx = ");
        double xPoint = Double.Parse(Console.ReadLine());
        Console.Write("y = ");
        double yPoint = Double.Parse(Console.ReadLine());
        double xCircle = 1;
        double yCircle = 1;
        double radius = 3;
        double xRect = 1;
        double yRect = -1;
        double rectWidth = 6;
        double rectHeight = 2;
        double hytopenuse = Math.Sqrt(Math.Pow((xPoint - xCircle), 2) + Math.Pow((yPoint - yCircle), 2));
        if (hytopenuse <= radius)
        {
            Console.Write("The point is WITHIN the cirle ");
            //A check if the point is inside the rectangle
            if ((xPoint >= xRect) && (xPoint <= (xRect + rectWidth))
                && (yPoint <= yRect) && (yPoint >= (yRect - rectHeight)))
            {
                Console.WriteLine("and WITHIN the rectangle.");
            }
            else
            {
                Console.WriteLine("but OUTSIDE the rectangle.");
            }
        }
        else
        {
            Console.Write("The point is OUTSIDE the cirle ");
            //A check if the point is inside the rectangle
            if ((xPoint >= xRect) && (xPoint <= (xRect + rectWidth))
                && (yPoint <= yRect) && (yPoint >= (yRect - rectHeight)))
            {
                Console.WriteLine("but WITHIN the rectangle.");
            }
            else
            {
                Console.WriteLine("and OUTSIDE the rectangle.");
            }
        }
    }
}
